In conventional digital image processing, when a blurred smoothed image is created by using low-pass filters, an average value of level values of pixels within the filter size is used as a signal level of the target pixel. However, when low-pass filters are used, because an average value of level values of pixels within the filter size is used as a level value of the target pixel, an edge portion where a difference between level values is large becomes blurred, which is a problem. Specifically, when the low-pass filters are used, as illustrated in FIG. 17, the gradient of the edge portion, in which the difference is large between brightness and darkness in the image to be processed (indicated by the solid line), becomes dull in a low-pass filter image (an LPF image is illustrated in the drawing and indicated by the dotted line) that is output from the low-pass filters; therefore, the edge portion cannot be preserved.
To solve such a problem, various technologies in which an edge portion in an image is accurately preserved and a portion other than the edge portion is blurred have been proposed. For example, Japanese Laid-open Patent Publication No. 2000-105815 discloses a technology related to a face image processing apparatus (image processing apparatus) using an epsilon filter.
Specifically, as illustrated in FIG. 18, the face image processing apparatus uses a pixel located at the coordinates (m, n) in the image as the target pixel and uses pixels neighboring the target pixel (in this case, eight pixels of the coordinates (m−1, n−1), the coordinates (m, n−1), the coordinates (m+1, n−1), the coordinates (m−1, n), the coordinates (m+1, n), the coordinates (m−1, n+1), the coordinates (m, n+1), and the coordinates (m+1, n+1)) as neighboring pixels. Subsequently, the face image processing apparatus calculates the difference between a level value of the target pixel (e.g., a grayscale value of a luminance signal) and a level value of the neighboring pixel and extracts neighboring pixels that have a calculated difference that is smaller than a predetermined threshold TH. Then, the face image processing apparatus outputs a value, which is obtained by adding the pixel value of the target pixel to a pixel value obtained by multiplying signal levels of the extracted neighboring pixels by a predetermined coefficient, as the pixel value of the target pixel.
In this way, with the technology described in Japanese Laid-open Patent Publication No. 2000-105815, a level range of a grayscale value is limited by processing only neighboring pixels that have the difference between the level value of the target pixel that is smaller than the threshold TH. Accordingly, as illustrated in FIG. 19, the gradient of the edge portion in an epsilon filter image (an epsilon filter image is illustrated in the drawing and indicated by the dotted line) that is output from an epsilon filter preserves, without becoming dull, the gradient of the edge portion in the image to be processed (indicated by the solid line); therefore, it is possible to accurately preserve an edge portion and to blur a portion other than the edge portion.
However, with the technology described above, there is a problem in that the noise removal level cannot be easily controlled, and, even when the noise removal level can be controlled, it is not possible to perform the process at high speed.
Specifically, noise in an image includes noise due to a change in brightness (luminance) and noise due to a change in color (hue). A change in color is noticeable by a human, and noise due to a change in color often tends to be present in a low luminance region. Accordingly, to remove noise due to a change in color while avoiding an unnatural appearance, the removal level of the noise due to a change in color needs to be changed in accordance with the luminance value of the input image. For example, with the technology described in Japanese Laid-open Patent Publication No. 2000-105815, when a smoothing process is performed, it is conceivable to use a method in which the noise removal level of an epsilon filter is made to be changed by calculating, for each input image, a luminance value and multiplying the filter coefficient according to the calculated luminance value by an epsilon filter. In such a case, however, the smoothing process needs to be performed, every time for each input image, by calculating the luminance value to obtain a filter coefficient and by multiplying the filter coefficient by the epsilon filter, causing the process to be extremely slow.